package com.springcloud.demo.gateway.controller;

import com.springcloud.demo.base.vo.ResultType;
import com.springcloud.demo.base.vo.ResultVO;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FallbackController {

    @RequestMapping("/404")
    public ResultVO<String> fallback404() {
        return ResultVO.<String>builder()
                .code(404)
                .data("服务未找到...")
                .build();
    }

    @RequestMapping("/500")
    public ResultVO<String> fallback500() {
        //return ResultVO.<String>fail(ResultType.FAIL)
        //        .data("服务错误...")
        //        .build();
        return ResultVO.fail(ResultType.FAIL, "服务错误...");
    }
}
